import './App.css';
import "antd/dist/antd.css"  //把antd css引入全局
import { BrowserRouter,Routes, Route } from 'react-router-dom';
import Login from "./Page/Login/Login"
import Admin from "./Page/Admin/Admin"
import Addarticle from './Page/AddArticle/Addarticle';
import WorkerSpace from './Page/WorkerSpace/WorkerSpace';
import ArticleList from "./Page/ArticleList/ArticleList"
import Drafts from './Page/Drafts/Drafts';

function App() {
  return (
      <BrowserRouter>
      <Routes>
        <Route path="/" element={<Login/>}/>
        <Route path="/login" element={<Login/>}/>
        <Route path="/admin" element={<Admin/>}>
            <Route index element={<WorkerSpace/>}/>
            <Route path="/admin/addarticle" exact element={<Addarticle/>}/>
            <Route path = "/admin/articleList" exact element={<ArticleList/>}/>
            <Route path = "/admin/draftsArticle" exact element={<Drafts/>}/>
            <Route path="/admin/addarticle/:id" exact element={<Addarticle/>}/>

        </Route>
      </Routes>
      </BrowserRouter>
      
  );
}

export default App;
